﻿/*
#------------------------------------------------------------------------------
#-- Program Name:	[dbo].[fnConfig_IsEndOfMonth]
#-- Purpose:		Is today the last day of the month.
#--	Last Update:	08/02/2012
#--					For a complete history - please review comments in Version
#--					control.
#-- Called By:		[dbo].[spBkp_Differential]
#------------------------------------------------------------------------------
*/
CREATE FUNCTION [dbo].[fnConfig_IsEndOfMonth]()
RETURNS BIT
AS
BEGIN
	RETURN	CAST(CASE	WHEN CAST(CONVERT(varchar(20), DATEADD(d, -DAY(DATEADD(m,1,GETDATE())),DATEADD(m,1,GETDATE())), 101) as datetime) = CAST(CONVERT(varchar(20), GETDATE(), 101) as datetime)
						THEN 1 ELSE 0 END as bit)
END
